/**
 * @format
 * @Author: TC
 * @Date: 2023-03-25 21:05:19
 * @Last Modified by: TC
 * @Last Modified time: 2025-05-05 01:45:50
 */

import JSZip from "../Lib/JsZip/jszip.js";
export namespace nsJsZip {
    export function jsZipGetData(data: ArrayBuffer, completeCallback: Function, failCallback?: Function) {
        let op = {
            base64: false,
            checkCRC32: false,
            optimizedBinaryString: true,
            createFolders: false,
        };
        JSZip.loadAsync(data, op)
            .then(function (zip: any) {
                let configKeyArray = [],
                    zipFiles = zip.files;
                for (let key in zipFiles) {
                    configKeyArray.push(key);
                }
                completeCallback(zip, configKeyArray);
            })
            .catch((res: any) => {
                failCallback && failCallback();
            });
    }
}
